package com.zhongmai.yzfgrabanorder.fragment;

import java.util.Stack;

/**
 * Created by 张俨 on 2018/2/7.
 */

public class FragmentsManager {

    private static FragmentsManager fragmentsManager = new FragmentsManager();
    public Stack<GrabAnOrderFragment> fragments = new Stack<>();

    public static FragmentsManager getInstance() {
        return fragmentsManager;
    }

    public Stack<GrabAnOrderFragment> getFragments() {
        return fragments;
    }

    public void addActivity(GrabAnOrderFragment fragment) {
        if (fragment == null) {
            return;
        }
        fragments.add(fragment);
    }

    public void removeActivity(GrabAnOrderFragment fragment) {
        if (fragment == null) {
            return;
        }
        fragments.remove(fragment);
    }
}
